﻿<UserControl x:Class="WpfRcp.Modules.Panels.Views.Controls.SecondTabView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             xmlns:Behaviors="clr-namespace:WpfRcp.Controls.Behaviors;assembly=WpfRcp.Controls"
             xmlns:Loc="clr-namespace:WpfRcp.Core.Common.Localization;assembly=WpfRcp.Core"
             Loc:ResxExtension.GlobalResxName="WpfRcp.Modules.Panels.Properties.Resources"
             xmlns:RcpControls="clr-namespace:WpfRcp.Controls;assembly=WpfRcp.Controls">

    <UserControl.Resources>
        
        <Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="True">
                    <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" />
                </Trigger>
            </Style.Triggers>
        </Style>

    </UserControl.Resources>

    <RcpControls:AccordionControl>

        <RcpControls:AccordionItem Header="{Loc:Resx Key=DisplayingFileContent}" IsSelected="True">

        <DockPanel>
        <GroupBox DockPanel.Dock="Top" Padding="5" VerticalAlignment="Top" BorderThickness="0" Background="Transparent">
            <GroupBox.Header>
                <Label Content="{Loc:Resx Key=SavingToFile}"
                       FontSize="16" FontWeight="Bold" />
            </GroupBox.Header>
            <DockPanel>
                <StackPanel>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="200" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>

                        <Label Grid.Column="0" Grid.Row="0" Margin="3,3,3,3"
                                   Content="{Loc:Resx Key=FileName}"/>
                        <TextBox Grid.Column="0" Grid.Row="1" Margin="3,3,3,3" Text="{Binding Path=FileName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="230" Height="24"/>
                        <Label Grid.Column="1" Grid.Row="1" Margin="3,3,3,3"
                                   Content="{Loc:Resx Key=TxtExtension}"/>

                        <Label Grid.Column="0" Grid.Row="2" Margin="3,3,3,3"
                                   Content="{Loc:Resx Key=Data}"/>
                        <Label Grid.Column="0" Grid.Row="3" Margin="3,3,3,3"
                                   Content="{Loc:Resx Key=FirstName}"/>
                                <TextBox Grid.Column="1" Grid.Row="3" Margin="3,3,3,3" Text="{Binding Path=FirstName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="230" Height="24"/>

                        <Label Grid.Column="0" Grid.Row="4" Margin="3,3,3,3"
                                   Content="{Loc:Resx Key=LastName}"/>
                                <TextBox Grid.Column="1" Grid.Row="4" Margin="3,3,3,3" Text="{Binding Path=LastName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="230" Height="24"/>

                                <Button Grid.Column="1" Grid.Row="5" Margin="3,3,3,3" Command="{Binding SaveFileCommand}" Width="75"
                                    Content="{Loc:Resx Key=Save}"></Button>

                        </Grid>
                    </StackPanel>
                </DockPanel>
            </GroupBox>
        </DockPanel>
        </RcpControls:AccordionItem>
    </RcpControls:AccordionControl>
</UserControl>
